-
Notifications
You must be signed in to change notification settings - Fork 54
chore: Add the FDv2 data system protocol implementation #346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add the FDv2 data system protocol implementation #346
Conversation
lib/ldclient-rb/impl/data_store/feature_store_client_wrapper.rb
Outdated
Show resolved
Hide resolved
lib/ldclient-rb/config.rb
Outdated
| # @param fdv1_fallback_synchronizer [Proc(Config) => LaunchDarkly::Interfaces::DataSystem::Synchronizer, nil] | ||
| # The (optional) builder proc for FDv1-compatible fallback synchronizer | ||
| # | ||
| def initialize(initializers:, primary_synchronizer:, secondary_synchronizer:, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to change it in this PR, but remember that we want to make synchronizers a list like the initializers.
Co-authored-by: Matthew M. Keeler <[email protected]>
lib/ldclient-rb/impl/data_store/feature_store_client_wrapper.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: Matthew M. Keeler <[email protected]>
Co-authored-by: Matthew M. Keeler <[email protected]>
| kind_data.each do |key, item| | ||
| items_of_kind[key] = item | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing version check allows stale updates to overwrite newer data
High Severity
The apply_delta method in InMemoryFeatureStoreV2 unconditionally overwrites items without checking version numbers. The existing InMemoryFeatureStore.upsert method correctly compares old[:version] < item[:version] before updating to prevent out-of-order updates from overwriting newer data. Without this check, network issues causing out-of-order delivery, retries, or reconnections could result in older flag/segment versions overwriting newer ones, leading to inconsistent SDK state and potentially incorrect flag evaluations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll talk with the team about this as it seems like a behavior question. We will address in a separate PR if needed.
Note
Establishes the experimental FDv2 data system foundation and wiring without concrete streaming/polling implementations.
DataSystemConfigandLaunchDarkly::DataSystembuilder (default,streaming,polling,custom,daemon,persistent_store) for configuring initializers/synchronizers and data store modeinterfaces/data_system.rbandimpl/data_system/protocolv2.rb(events, selectors, changesets, payloads, initializers/synchronizers contracts)Impl::DataSystem::FDv2orchestrator to run initializers, manage primary/secondary/fallback synchronizers, track readiness, and report data availabilityInMemoryFeatureStoreV2, dual-modeImpl::DataStore::Store(memory vs persistent), andFeatureStoreClientWrapperV2with availability monitoring/recoveryDependencyTrackerand a minorModel.deserializeguard; documentsFeatureStore#stopidempotencyConfigwith experimentaldatasystem_configoptionWritten by Cursor Bugbot for commit 1de1704. This will update automatically on new commits. Configure here.